package net.liteheaven.dtimer.timer

import net.liteheaven.dtimer.timer.DTimerManager
import kotlin.properties.Delegates

/**
 * Created by LiangYu on 2018/7/31.
 */
class DToken (id: Int, delay: Long, once: Boolean) {

    var id: Int by Delegates.notNull()
    var delay: Long by Delegates.notNull()
    var once: Boolean by Delegates.notNull()

    init{
        this.id = id
        this.delay = delay
        this.once = once
    }

    fun cancel(){
        DTimerManager.stopTimer(this.id)
    }
}